<template>
    <div class="main">
        <div class="type">
            <span>请选择{{typeName}}的二级分类</span>
        </div>
        <div class="list"  v-for="(item,index) in data" 
            @click="jumpDetail(item)"
            :key="index">
            <div class="title">
            {{item.TypeName}}
            </div>
              <img class="icon" src="@/assets/Images/AppIcon/icon_arrow_right.png" />
        </div>
    </div>
</template>

<script>
export default {

	data() {
		return {
            firstTypeCode: this.$route.query.TypeCode,
            typeName: this.$route.query.TypeName,
            Info:this.$route.query.Info,
            data: {},
        }
	},

    created() {
        this.ListGroupName();
	},

    methods:{

        // 获取二级上报类型
        ListGroupName(){
            let params = { firstTypeCode: this.firstTypeCode };
            this.$axios.get('/ChsClueType/GetClueListByCode', { params: params }).then((res) => {
                this.data = res.data;            
            });
        },

        // 跳转到填写个人信息画面
        jumpDetail(item){
            this.$router.push({
                path: "/chsReport/Edit",
                query: {
                    Info:this.Info,
                    TypeCode:item.TypeCode,
                },
            });
        }
    }
}
</script>

<style lang="less" scoped>
.main{
    font-size: 14px;
}
.list{
    display:flex;
    justify-content:space-between;
    background-color: white;
    border-bottom: 1px solid #cccccc;
    padding:10px;
    align-items: center;
}
.title{
    padding-right:10px;
    white-space: nowrap;
    overflow : hidden;
    text-overflow: ellipsis;
}
img{
    width: 15px;
    height: 15px;
}
.type{
    padding: 10px;
}
</style>
